package com.bwie.parkdemo.mvvm.model;

import com.bwie.lib_core.base.BaseEntity;
import com.bwie.lib_core.mvvm.base.BaseModel;
import com.bwie.lib_core.network.HttpRetrofitFactory;
import com.bwie.lib_core.network.HttpType;
import com.bwie.parkdemo.mvvm.model.entity.HistorySignEntity;

import io.reactivex.Observable;
import okhttp3.RequestBody;

public class HistorySignModel extends BaseModel {
    //月度考勤
    @Override
    public Observable<BaseEntity> request(RequestBody... bodyes) {
        Observable<HistorySignEntity>source = HttpRetrofitFactory
                .getInstance().factory(HttpType.TOKENINTERFACE)
                .getRetrofit().create(Api.class).requestMonthSign(bodyes[0]);
        return changeOB(source);
    }

    //日考勤查询
    public Observable<BaseEntity> requestDaySign(){
        Observable<HistorySignEntity>source = HttpRetrofitFactory
                .getInstance().factory(HttpType.TOKENINTERFACE)
                .getRetrofit().create(Api.class).requestDaySign();
        return changeOB(source);
    }


    @Override
    public void cleared() {

    }
}
